package main

import (
	"gin/cdai"
	"gin/cdai/task"
	"github.com/spf13/viper"
	"os"
)

func main() {
	InitConfig()
	cdai.Init()
	var fileName = "/data/mxxSgZLyYX_3421ff59c4c36ac9bd512d886d293b3a/mxxSgZLyYX_3421ff59c4c36ac9bd512d886d293b3a.mp3"
	var callback = "http://10.168.30.17:19177/task/ai_task_call_back"
	resp, err := task.CreateFaceTask(fileName, callback)
	if err != nil {
		println(err.Error())
		return
	}
	println(*resp.Rows.FileName)

}

func InitConfig() {
	workDir, _ := os.Getwd()
	viper.SetConfigName("application")
	viper.SetConfigType("yml")
	viper.AddConfigPath(workDir + "/config")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
}
